< previous page page_524 next page >

Page 524
Example program Rotate, shown in Figure 14.36, demonstrates the Extrusion3d class. Use the option buttons to pick the surface you want to see. Use the arrow keys to change the program's viewing direction.
Figure 14.37 shows several surfaces of rotation produced by the program with their base curves drawn in heavy lines. All the surfaces' base curves lie in the X-Y plane, so each of the surfaces is made up of trapezoids.
Other Surfaces of Transformation
You create extruded surfaces by translating a curve along a path. You create a surface of revolution by rotating a curve around an axis of rotation. In both cases, you create a series of copies of the original base curve, properly transformed.
You can generalize this method to allow other types of transformations. To create the series of curves, you can use translation, rotation, reflection, stretching, and even shape-distorting transformations. This usually produces a surface made up of bent trapezoids like the ones that make up the surface in Figure 14.35. Only when the base curve and the transformations have the proper relationships will the areas that define the surface be flat trapezoids.
The generating path used to construct extruded surfaces and the axis of rotation used to construct surfaces of revolution provide easy, intuitive ways to specify the transformations that should be applied to the base curve. Specifying a series of more general transformations is not as intuitive. One way to manage these transformations is to explicitly create them and store them in a transformation array. You can then apply the transformations to the base curve to create the surface.
0524-01.jpg
Figure 14.36
Program Rotate creating a surface of revolution.

 
< previous page page_524 next page >